Skip to content

Fix theme picker rendering the border colour as a fill - #624

Merged
Juliusolsson05 merged 1 commit into
mainfrom
fix/theme-picker-cell-background
Jul 28, 2026
Merged

Fix theme picker rendering the border colour as a fill#624
Juliusolsson05 merged 1 commit into
mainfrom
fix/theme-picker-cell-background

Conversation

@Juliusolsson05

Copy link
Copy Markdown
Owner

The Theme picker drew as a grey block instead of a grid of cells.

Cause

ThemePickerRow.tsx:46 uses a seam trick — a gap-px grid whose parent is painted with the border colour, so only the 1px gaps show it:

<div className="grid grid-cols-2 gap-px border border-panel-border bg-panel-border">

That depends on every cell being opaque. They weren't:

Token Value Result
--theme-row-bg transparent parent's border colour floods the cell
--theme-row-selected-bg color-mix(… accent 15%, transparent) tinted, still leaks
--theme-row-hover-bg var(--theme-surface-hi) opaque — the one state that looked right

So the border colour was being used as a fill across the whole picker.

Both leaking tokens are correct defaults for an ordinary row sitting on a panel. They are simply wrong under a parent painted with the border colour.

Fix

The component now names opaque tokens explicitly, rather than depending on tokens whose own definition documents them as transparent:

  • resting cells → bg-panel-bg
  • selected cell → new --theme-row-selected-solid-bg, the same 15% accent mixed against --theme-surface instead of transparent

Both derive from roles Custom Appearance already exposes (accent, surface, panelBg), so custom themes keep tuning it.

The new variable is deliberately not added to the customAppearance role map — it is a derived companion to an existing role, not a new role to configure.

Blast radius

ThemePickerRow is the only component using this seam pattern (grepped gap-px and bg-panel-border), so this is one file plus one token.

Verification

tsc clean on both projects, 1721 tests / 251 files green.

Not visually confirmed in a running app — the change is a token swap reasoned from the CSS.

🤖 Generated with Claude Code

The Theme picker drew as a grey block instead of a grid of cells.

ThemePickerRow uses a seam trick: a `gap-px` grid whose PARENT is painted with
the border colour, so only the 1px gaps show it. That depends on every cell
being opaque. The cells used `bg-row-bg` and `bg-row-selected-bg`, and both of
those tokens are deliberately see-through — `transparent`, and a 15% accent mix
against `transparent`. So the parent's border colour flooded every cell, and
the picker rendered with the border colour used as a fill.

Both are correct defaults for an ordinary row sitting on a panel; they are just
wrong under a parent painted with the border colour. `bg-row-hover-bg` was
always opaque (`--theme-surface-hi`), which is why hover was the one state that
looked right, and the selected cell only looked plausible because a 15% tint
over grey still reads as tinted.

Cells now name opaque tokens explicitly rather than depending on tokens whose
own definition documents them as transparent: `bg-panel-bg` for the resting
state, and a new `--theme-row-selected-solid-bg` that mixes the same 15% accent
against `--theme-surface` instead of `transparent`. Both derive from roles
Custom Appearance already exposes, so custom themes keep tuning it.

The new token is deliberately NOT added to the customAppearance role map: it is
a derived companion to an existing role, not a new role to configure.

ThemePickerRow is the only component using this seam pattern, so the blast
radius is one file plus the token.

Verified: tsc clean on both projects, 1721 tests / 251 files green.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@Juliusolsson05
Juliusolsson05 merged commit bbe9787 into main Jul 28, 2026
1 check passed
@Juliusolsson05
Juliusolsson05 deleted the fix/theme-picker-cell-background branch July 28, 2026 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant